//
//  UserInfoViewController.m
//  EducationOID
//
//  Created by slz on 2017/7/10.
//  Copyright © 2017年 bnsr. All rights reserved.
//

#import "UserInfoViewController.h"
#import "ProgressViewController.h"
#import "ChangeInfoViewController.h"

@interface UserInfoSubItemView : UIView
@property (nonatomic,strong) UIImageView *iconImage;
@property (nonatomic,strong) UILabel *titleLabel;
@end

@implementation UserInfoSubItemView

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self){
        self.backgroundColor = [UIColor whiteColor];
        _iconImage = [[UIImageView alloc]initWithFrame:CGRectMake(11, 11, 28, 28)];
        [self addSubview:_iconImage];
        
        _titleLabel = [UILabel new];
        _titleLabel.textColor = kDark_TextColor_Default;
        _titleLabel.fontSize = 15;
        [self addSubview:_titleLabel];
        [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(_iconImage.mas_right).offset(10);
            make.centerY.mas_equalTo(self.mas_centerY);
        }];
        
        UIImageView * arrowImage = [UIImageView new];
        arrowImage.frame = CGRectMake(kScreenWidth - 43, 11, 28, 28);
        arrowImage.image = [UIImage imageNamed:@"user_info_arrow"];
        [self addSubview:arrowImage];
    }
    return self;
}

@end

@interface UserInfoViewController ()
@property (nonatomic,strong) UserInfoSubItemView *itemView1;
@property (nonatomic,strong) UserInfoSubItemView *itemView2;
@end

@implementation UserInfoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.showNavigationBar = YES;
    [self setControllerTitle:@"个人中心"];
    self.view.backgroundColor = kChange_InfoColor_bakc_Default;

    
    _itemView1 = [[UserInfoSubItemView alloc]init];
    [_itemView1 addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(progressAction)]];
    _itemView1.titleLabel.text = @"OID申请进度";
    _itemView1.iconImage.image = [UIImage imageNamed:@"user_info_oid"];
    _itemView1.frame = CGRectMake(0, 11, kScreenWidth, 50);
    [self.view addSubview:_itemView1];
    
    _itemView2 = [[UserInfoSubItemView alloc]init];
    [_itemView2 addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(changeAaction)]];
    _itemView2.titleLabel.text = @"个人信息修改";
    _itemView2.iconImage.image = [UIImage imageNamed:@"user_info_pen"];
    _itemView2.frame = CGRectMake(0, _itemView1.bottom + 11, kScreenWidth, 50);
    [self.view addSubview:_itemView2];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)changeAaction{
    [self.navigationController pushViewController:[[ChangeInfoViewController alloc]init] animated:YES];
}

- (void)progressAction{
    [self.navigationController pushViewController:[[ProgressViewController alloc]init] animated:YES];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
